$(function() {
	//提交评价
	$("#sub_btn").click(function() {
		var repairId = $("#repairId").val();
		var evaluate = $("#evaluate").val();
		var serviceSpeed = $("#serviceSpeed").attr("data");
		var quality = $("#quality").attr("data");
		var serviceAttitude = $("#serviceAttitude").attr("data");

		var data = 'repairId=' + repairId;
		data += '&evaluate=' + evaluate;
		data += '&serviceSpeed=' + serviceSpeed;
		data += '&quality=' + quality;
		data += '&serviceAttitude=' + serviceAttitude;
		
		$("#sub_btn").button("loading");
		$.post('/wx/property/repair/evaluate/data', data, function(result) {
			if (result.resultCode == "0") {
				$("#errmsg").text("评价成功!");
				$('#my-alert').modal({
					relatedTarget: this,
				});
				setTimeout('location.href="javascript:history.back();"', 1000);
			} else {
				$("#errmsg").text(result.datas);
				$('#my-alert').modal({
					relatedTarget: this,
				});
			}
		});
	});

	$(".appraisal_set b").click(function () {
        $(this).parent().find("i").removeClass("set_on_icon");
        $(this).find("i").addClass("set_on_icon");
        $(this).parent().attr("data", $(this).index());
    });
});

